﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Camc.Quality.Migrations
{
    public partial class _20211022160504_20211021022519_updatestoreputcontent : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<Guid>(
                name: "CollectBomManagerId",
                table: "StoreStocks",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "DesignatedXJCode",
                table: "StoreStockContents",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "JianNum",
                table: "StorePutContents",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "StoreAmount",
                table: "StorePutContents",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.CreateTable(
                name: "CollectBomManagerChildren",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    CollectBomManagerId = table.Column<Guid>(nullable: true),
                    BomDesignId = table.Column<Guid>(nullable: false),
                    MaterialId = table.Column<Guid>(nullable: false),
                    ParentMaterialId = table.Column<Guid>(nullable: false),
                    ParentId = table.Column<Guid>(nullable: false),
                    Unit1BomDosage = table.Column<int>(nullable: false),
                    LevelRelationship = table.Column<string>(nullable: true),
                    LevelNum = table.Column<int>(nullable: false),
                    Status = table.Column<int>(nullable: false),
                    Remark = table.Column<string>(nullable: true),
                    OrderNum = table.Column<int>(nullable: false),
                    VersionNo = table.Column<string>(nullable: true),
                    MaterialProperty = table.Column<int>(nullable: false),
                    BomDosageTotalAmount = table.Column<int>(nullable: false),
                    ModifiChangeId = table.Column<Guid>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CollectBomManagerChildren", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "CollectBomManagerChildren");

            migrationBuilder.DropColumn(
                name: "CollectBomManagerId",
                table: "StoreStocks");

            migrationBuilder.DropColumn(
                name: "DesignatedXJCode",
                table: "StoreStockContents");

            migrationBuilder.DropColumn(
                name: "JianNum",
                table: "StorePutContents");

            migrationBuilder.DropColumn(
                name: "StoreAmount",
                table: "StorePutContents");
        }
    }
}
